package com.abc.scholarship.common.utils;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-07-04  14:22
 */
public class MajorGradeNumUtil {

    /**
     * 根据班级名获取前缀
     * @param clazz
     * @return
     */
    public static String getMajorGrade(String clazz) {
        int beginIndex = 0;
        for(int i = 0; i < clazz.length(); i++){
            if (clazz.charAt(i) <= '9' && clazz.charAt(i) >= '0'){
                beginIndex = i;
                break;
            }
        }
        return clazz.substring(0, beginIndex + 4);
    }
}
